package com.molichuxing.gateway.api.services;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.result.ResponseResult;
import com.molichuxing.gateway.bff.order.entity.request.create.*;
import com.molichuxing.gateway.bff.order.entity.response.*;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 企业订单相关接口
 *
 * @Author zoumingyu
 * @Date 2020年06月03日
 */
public interface OrderEnterpriseApiService {


    ResponseResult<List<OrderTradeFlowVo>> OrderEnterpriseStateFlow(Long orderCode);

    /**
     * 查询企业订单列表
     *
     * @return
     */
    ResponseResult<Paged<OrderEnterpriseCarBizVo>> orderEnterpriseCarList(Map<String, Object> params, Integer pageNum, Integer pageSize);
    /**
     * 查询企业订单列表
     *
     * @return
     */
    ResponseResult<Paged<OrderEnterpriseListVo>> orderEnterpriseList( Map<String, Object> params, Integer pageNum,  Integer pageSize);

    /**
     * 查询企业订单基本信息
     *
     * @param orderCode 订单号
     * @return
     */
    ResponseResult<OrderEnterpriseBaseVo> getEnterpriseBase(Long orderCode);

    @ApiOperation(value = "企业订单车型车辆列表")
    @ApiImplicitParam(name = "orderCode", value = "订单号", required = true, dataType = "Long")
    @GetMapping(value = "/order/model/car")
    ResponseResult<List<OrderEnterpriseModelCarVo>> getOrderEnterpriseModelCar(@RequestParam Long orderCode);

    /**
     * 查询企业订单车辆明细
     *
     * @param orderCode 订单号
     * @return
     */
    ResponseResult<OrderEnterpriseCarDetailVo> getEnterpriseCar(Long orderCode);

    /**
     * 查询企业订单交车信息
     *
     * @param orderCode 订单号
     * @return
     */
    ResponseResult<List<OrderEnterpriseCarHandoverVo>> getEnterpriseCarDelivery(Long orderCode);

    /**
     * 查询企业订单还款信息
     *
     * @param orderCode 订单号
     * @return
     */
    ResponseResult<OrderEnterpriseRepaymentDetailVo> getEnterpriseRepayment(Long orderCode);

    /**
     * 还款计划
     *
     * @param params
     * @param pageNum
     * @param pageSize
     * @return
     */
    ResponseResult<Paged<EnterpriseScheduleVo>> getEnterpriseSchedulePage(Map<String, Object> params, Integer pageNum, Integer pageSize);

    /**
     * 还款详情
     *
     * @param scheduleId
     * @return
     */
    ResponseResult<PaymentEnterpriseInfoVo> getPaymentEnterpriseInfo(Integer scheduleId);

    /**
     * 退租
     *
     * @param orderEnterpriseReturnCreateVo
     * @return
     */
    ResponseResult<Boolean> createOrderEnterpriseReturn(OrderEnterpriseReturnCreateVo orderEnterpriseReturnCreateVo,BindingResult bindingResult);

    /**
     * 退租详情
     *
     * @param carHandoverId
     * @return
     */
    ResponseResult<OrderEnterpriseCarReturnVo> getOrderEnterpriseReturnDetail(Integer carHandoverId);

    /**
     * 交车
     *
     * @param orderEnterpriseDeliveryCreateVo
     * @return
     */
    ResponseResult<Boolean> createOrderEnterpriseDelivery(OrderEnterpriseDeliveryCreateVo orderEnterpriseDeliveryCreateVo, BindingResult bindingResult);


    /**
     * 新增企业订单
     *
     * @param createVo
     * @param bindingResult
     * @return
     */
    ResponseResult<Boolean> create(OrderEnterpriseCreateVo createVo, BindingResult bindingResult);

    /**
     * 续租
     *
     * @param createVo
     * @param bindingResult
     * @return
     */
    ResponseResult<Boolean> createRenew(OrderEnterpriseCreateVo createVo, BindingResult bindingResult);

    /**
     * 企业车辆过户
     *
     * @param createVo
     * @param bindingResult
     * @return
     */
    ResponseResult<Boolean> createEnterpriseCarTransfer(EnterpriseCarTransferCreateVo createVo,
                                                        BindingResult bindingResult);

    /**
     * 企业车辆过户详情
     *
     * @param vin
     * @return
     */
    ResponseResult<EnterpriseCarTransferVo> getEnterpriseCarTransfer(String vin);

    /**
     * 企业订单支付
     *
     * @param createVo
     * @return
     */
    ResponseResult<Boolean> createPay(EnterprisePayCreateVo createVo, BindingResult bindingResult);

    /**
     * 企业订单还款
     *
     * @param createVo
     * @return
     */
    ResponseResult<Boolean> createRepay(EnterprisePayCreateVo createVo, BindingResult bindingResult);

    /**
     * 验证企业订单还款
     *
     * @param orderCode  订单号
     * @param scheduleId 排期id
     * @return
     */
    ResponseResult<EnterpriseScheduleVerifyVo> getVerifyRepay(Long orderCode, Integer scheduleId);

    /**
     * 查询订单和车辆信息
     *
     * @param orderCode 订单号
     * @return
     */
    ResponseResult<EnterpriseAndCarVo> getEnterprise(Long orderCode);


    @ApiOperation(value = "续租校验")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orderCode", value = "订单号", required = true, dataType = "Long"),
    })
    @GetMapping(value = "/check/renew")
    ResponseResult<Boolean> checkRenew(Long orderCode);

    /**
     * 起租确认
     */
    ResponseResult<Boolean> leaseConfirm(EnterpriseLeaseConfirmCreateVo createVo,
                                         BindingResult bindingResult);

    /**
     * 根据车辆查询企业订单列表
     *
     * @return
     */
    ResponseResult<List<OrderEnterpriseListVo>> orderEnterpriseListByCarId( Integer carId);

}
